import {actionTypes} from './index'
import axios from 'axios'

export const getChangeLoginStatusAction = (data) => ({
    type: actionTypes.CHANGE_LOGIN_STATUS,
    data
})
export const ajaxLogin = (account, password) => {
    return (dispatch) => {
        console.log(account, password)
        axios.get('/api/login.json?account=' + account + '&password=' + password).then((res) => {
            const data = res.data;
            if (data.success) {
                dispatch(getChangeLoginStatusAction(data.data))
            }
        }).catch((error) => {

        })
    }
}
